#include <iostream>
#include <fstream>
using namespace std;

int CountSeparatedWords(const char* filename)
{
	ifstream InFile(filename);
	string dummy[2048];
	int count = 0;
	if (InFile.is_open())
	{
		while( !InFile.eof() )
		{
			InFile >> dummy[count++];
		}
	}
	InFile.close();
	cout << "There are " << count << " whitespace-separated words in file " << filename << ", they are:" << endl;
	for ( int k = 0 ; k < count ; k ++)
	{
		cout << dummy[k] << "  ";
	}
	return count;
}